Skip to content

Commit

Permalink
Merge tag 'zynq-soc-for-3.20' of https://github.com/Xilinx/linux-xlnx
Browse files Browse the repository at this point in the history
…into next/soc

Merge "Zynq SoC changes for 3.20" from Michal Simek:

arm: Xilinx Zynq SoC patches for v3.20

- Enable pincontrol
- Simplified SLCR initialization
- Setup default ARCH_NR_GPIO

* tag 'zynq-soc-for-3.20' of https://github.com/Xilinx/linux-xlnx:
  ARM: zynq: Simplify SLCR initialization
  ARM: zynq: PM: Fixed simple typo.
  ARM: zynq: Setup default gpio number for Xilinx Zynq
  ARM: zynq: Enable pinctrl

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Jan 29, 2015
2 parents ff6a816 + 3329659 commit ee481c8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 32 deletions.
2 changes: 1 addition & 1 deletion arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ config ARM_PSCI
# selected platforms.
config ARCH_NR_GPIO
int
default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
default 1024 if ARCH_SHMOBILE || ARCH_TEGRA || ARCH_ZYNQ
default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \
SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210
default 416 if ARCH_SUNXI
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-zynq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ config ARCH_ZYNQ
select HAVE_ARM_TWD if SMP
select ICST
select MFD_SYSCON
select PINCTRL
select PINCTRL_ZYNQ
select SOC_BUS
help
Support for Xilinx Zynq ARM Cortex A9 Platform
2 changes: 0 additions & 2 deletions arch/arm/mach-zynq/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ static void __init zynq_init_machine(void)

platform_device_register(&zynq_cpuidle_device);
platform_device_register_full(&devinfo);

zynq_slcr_init();
}

static void __init zynq_timer_init(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-zynq/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void __iomem *zynq_pm_ioremap(const char *comp)
/**
* zynq_pm_late_init() - Power management init
*
* Initialization of power management related featurs and infrastructure.
* Initialization of power management related features and infrastructure.
*/
void __init zynq_pm_late_init(void)
{
Expand Down
35 changes: 7 additions & 28 deletions arch/arm/mach-zynq/slcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ static struct regmap *zynq_slcr_regmap;
*/
static int zynq_slcr_write(u32 val, u32 offset)
{
if (!zynq_slcr_regmap) {
writel(val, zynq_slcr_base + offset);
return 0;
}

return regmap_write(zynq_slcr_regmap, offset, val);
}

Expand All @@ -65,12 +60,7 @@ static int zynq_slcr_write(u32 val, u32 offset)
*/
static int zynq_slcr_read(u32 *val, u32 offset)
{
if (zynq_slcr_regmap)
return regmap_read(zynq_slcr_regmap, offset, val);

*val = readl(zynq_slcr_base + offset);

return 0;
return regmap_read(zynq_slcr_regmap, offset, val);
}

/**
Expand Down Expand Up @@ -195,23 +185,6 @@ void zynq_slcr_cpu_state_write(int cpu, bool die)
writel(state, zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET);
}

/**
* zynq_slcr_init - Regular slcr driver init
* Return: 0 on success, negative errno otherwise.
*
* Called early during boot from platform code to remap SLCR area.
*/
int __init zynq_slcr_init(void)
{
zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
if (IS_ERR(zynq_slcr_regmap)) {
pr_err("%s: failed to find zynq-slcr\n", __func__);
return -ENODEV;
}

return 0;
}

/**
* zynq_early_slcr_init - Early slcr init function
*
Expand All @@ -237,6 +210,12 @@ int __init zynq_early_slcr_init(void)

np->data = (__force void *)zynq_slcr_base;

zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
if (IS_ERR(zynq_slcr_regmap)) {
pr_err("%s: failed to find zynq-slcr\n", __func__);
return -ENODEV;
}

/* unlock the SLCR so that registers can be changed */
zynq_slcr_unlock();

Expand Down

0 comments on commit ee481c8

Please sign in to comment.